package com.hp.airmap.common;

import android.os.Bundle;

/**
 * 创建时间： 2017/1/19
 * 作者：胡鹏
 * 用途：View基类
 */

public abstract class MvpBaseActivity<V,T extends BasePresenter<V>> extends BaseActivity {
    protected T mPresenter;

    @SuppressWarnings("unchecked")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter=createPresenter();
        mPresenter.attachView((V)this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mPresenter.detachView();
    }

    protected abstract T createPresenter();
}
